package com.bwie.controller;

import com.bwie.pojo.TbCombo;
import com.bwie.pojo.TbShop;
import com.bwie.service.TbShopService;
import com.bwie.utils.R;
import com.bwie.vo.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:
 *
 * @Author zhaohaoyang
 * @Create 2025/7/15 13:18
 * @Version 1.0
 */
@RestController
@RequestMapping("/shop/index")
public class IndexController {

    @Autowired
    TbShopService tbShopService;

    /**
     * 套餐分页列表
     * @param pageVo
     * @return
     */
    @PostMapping("/getComboList")
    public R getComboList(@RequestBody PageVo pageVo){
        return tbShopService.getComboList(pageVo);
    }

    /**
     * 店铺分页列表
     * @param pageVo
     * @return
     */
    @PostMapping("/getShopList")
    public R getShopList(@RequestBody PageVo pageVo){
        return tbShopService.getShopList(pageVo);
    }

    /**
     * 优惠券分页列表
     * @param pageVo
     * @return
     */
    @PostMapping("/getCouponList")
    public R getCouponList(@RequestBody PageVo pageVo){
        return tbShopService.getCouponList(pageVo);
    }

    /**
     * 抢购套餐
     * @param tbCombo
     * @return
     */
    @PostMapping("/buyCombo")
    public R buyCombo(@RequestBody TbCombo tbCombo){
        return tbShopService.buyCombo(tbCombo);
    }

    /**
     * 核销优惠券
     * @param tbShop
     * @return
     */
    @PostMapping("/cancleCoupon")
    public R cancleCoupon(@RequestBody TbShop tbShop){
        return tbShopService.cancleCoupon(tbShop);
    }

    /**
     * 关联优惠券
     * @param tbShop
     * @return
     */
    @PostMapping("/concatCoupon")
    public R concatCoupon(@RequestBody TbShop tbShop){
        return tbShopService.concatCoupon(tbShop);
    }

}
